import service from "../utils/request";

//http://localhost:8001/goods/tag?tag=%E5%86%85%E8%A1%A3
export const getGoosByTag = (tag)=>{
    return service({
        url: 'goods/tag',
        method: 'get',
        params: {
            tag: tag,
            pageSize: 10,
            pageNum: 1
        }
    })
}

export function getGoodById(id){
    return service({
        url: 'goods/detail',
        method: 'get',
        params: {
            id: id
        }
    })
}

export function fetchGoodList(){
    return service({
        url: 'goods/',
        method: 'get',
        params: {
            pageSize: 10,
            pageNum: 1
        }
    })
}


export function apiCreateGood(data){
    return service({
        url: 'goods/',
        method: 'post',
        data: data
    })
}
